<div class="row-fluid">
	<div class="span6">
		<?php $this->renderPartial('_form', array('model'=>$formModel)); ?>
	</div>
	<div class="span6">
		<div class="widget-box">
			<div class="widget-title">
				<span class="icon">
					<i class="icon-th-list"></i>
				</span>
				<h5><?php echo Rights::t('core', 'Relations'); ?></h5>
			</div>
			<div class="widget-content">
				<?php if( $model->name!==Rights::module()->superuserName ): ?>

					<div class="parents">

						<h4><?php echo Rights::t('core', 'Parents'); ?></h4>

						<?php $this->widget('zii.widgets.grid.CGridView', array(
							'dataProvider'=>$parentDataProvider,
							'template'=>'{items}',
							'hideHeader'=>true,
							'emptyText'=>Rights::t('core', 'This item has no parents.'),
							'htmlOptions'=>array('class'=>'grid-view parent-table mini'),
							'columns'=>array(
								array(
									'name'=>'name',
									'header'=>Rights::t('core', 'Name'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'name-column'),
									'value'=>'$data->getNameLink()',
								),
								array(
									'name'=>'type',
									'header'=>Rights::t('core', 'Type'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'type-column'),
									'value'=>'$data->getTypeText()',
								),
								array(
									'header'=>'&nbsp;',
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'actions-column'),
									'value'=>'',
								),
							)
						)); ?>

					</div>

					<div class="children">

						<h4><?php echo Rights::t('core', 'Children'); ?></h4>

						<?php $this->widget('zii.widgets.grid.CGridView', array(
							'dataProvider'=>$childDataProvider,
							'template'=>'{items}',
							'hideHeader'=>true,
							'emptyText'=>Rights::t('core', 'This item has no children.'),
							'htmlOptions'=>array('class'=>'grid-view parent-table mini'),
							'columns'=>array(
								array(
									'name'=>'name',
									'header'=>Rights::t('core', 'Name'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'name-column'),
									'value'=>'$data->getNameLink()',
								),
								array(
									'name'=>'type',
									'header'=>Rights::t('core', 'Type'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'type-column'),
									'value'=>'$data->getTypeText()',
								),
								array(
									'header'=>'&nbsp;',
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'actions-column'),
									'value'=>'$data->getRemoveChildLink()',
								),
							)
						)); ?>

					</div>

					<div class="addChild">
						<?php if( $childFormModel!==null ): ?>

							<?php $this->renderPartial('_childForm', array(
								'model'=>$childFormModel,
								'itemnameSelectOptions'=>$childSelectOptions,
							)); ?>

						<?php else: ?>

							<p class="info"><?php echo Rights::t('core', 'No children available to be added to this item.'); ?>

						<?php endif; ?>

					</div>

				<?php else: ?>

					<p class="info">
						<?php echo Rights::t('core', 'No relations need to be set for the superuser role.'); ?><br />
						<?php echo Rights::t('core', 'Super users are always granted access implicitly.'); ?>
					</p>

				<?php endif; ?>
			</div>
		</div>
	</div>
</div>